#include "osgMeasureEvent.h"
#include "osgMeasurePtEvent.h"
#include "osgMeasureSingleLineEvent.h"
#include "osgMeasureMultiLineEvent.h"
#include "osgMeasureAreaEvent.h"

COsgMeasureEvent::COsgMeasureEvent(osgViewer::View *view, osg::Group *root, IEventCall *iCall)
{
    CBaseUserEvent* ptMeasureEvent = new COsgMeasurePtEvent(view, root, iCall);
    CBaseUserEvent* lineMeasureEvent = new COsgMeasureLineEvent(view, root, iCall);
    CBaseUserEvent* multiLineMeasureEvent = new COsgMeasureMultiLineEvent(view, root, iCall);
    CBaseUserEvent* areaMeasureEvent = new COsgMeasureAreaEvent(view, root, iCall);
	vecMeasureEvent.push_back(ptMeasureEvent);
	vecMeasureEvent.push_back(lineMeasureEvent);
	vecMeasureEvent.push_back(multiLineMeasureEvent);
	vecMeasureEvent.push_back(areaMeasureEvent);
}


void COsgMeasureEvent::addEventToViewer(osgViewer::View *view)
{
	for (int i = 0; i < vecMeasureEvent.size(); i++)
	{
		view->addEventHandler(vecMeasureEvent[i]);
	}
}
